gusucode.com > 忠网网站广告管理系统 ZonGG V1.3 > 忠网网站广告管理系统 ZonGG V1.3\code\GGtiao.asp

    <!-- #INCLUDE FILE="login.asp" -->
<%
	'///*********************************
	'   广告条以多种方式列表显示程序
	'********************************///

	if trim(request("actions"))="by" then  '如果为备用 在此 判断是否可管 
    Call AdminQx(3,"all")
    end if
	
	Dim pageurl:pageurl="?actions="&trim(request("actions"))&"&wei="&request("wei")&"&keyword="&request("keyword")&"&cid="&trim(request("cid"))&"&pid="&trim(request("pid"))&"&xslx="&trim(request("xslx"))&"&act="&trim(request("act"))&"&px="&request("px")&"&"   '分页连接公共地址
	Dim rssum:rssum=0
	Dim maxpage:maxpage=10
	Dim pp:pp=10
	Dim font_color:font_color="red"
	thepages="10"
	Dim addsql
	addsql=""
	Dim xslx
	
	action=trim(request("action"))
	
	'response.write action&" "
	select case action
	case "ruku"
	  dqw="验证新添加的广告条信息"
	  Call Heads_GGtiao(dqw)
	  call GgtiaoxxRuku()
	case "act"
	  call GGtiaoClose(trim(request("adids")),trim(request("actz")))
	  call GGtiaoMain()
	case "ip"
	  call GGtiaoIpkg(trim(request("adids")),trim(request("ipz")))
	  call GGtiaoMain()
	case else
	  call GGtiaoMain()
	end select


'/********************************************************************
' GGtiaoClose(adids,z) 暂停或激活一组广告条 参数:adids  广告条ID组 用","分割,z 表示暂停(0)或激活(1)的值 
'********************************************************************/

  sub GGtiaoClose(adids,z)
  if isnumeric(z) then
  Dim adidss,adidssi
  adidss=split(adids&",",",")  
  For adidssi=0 to Ubound(adidss)-1
  if isnumeric(adidss(adidssi)) then
  conn.execute("Update Advertisement set ADact="&cint(z)&"  where ADid="&adidss(adidssi))
	  if xmltype=1 then 
	  call PubEditXml(dataxml&"/Advertisement/"&adidss(adidssi)&"/adv.xml","Advertisement","3",z)    '为 adv.xml 文件 ADact 设置新值
	  end if
  end if 
  Next
  end if
  end sub


'/********************************************************************
' GGtiaoIpkg(adids,z) 打开、关闭一组广告条的IP开关 参数:adids  广告条ID组 用","分割,z 表示关 (0)或开(1)的值 
'********************************************************************/

  sub GGtiaoIpkg(adids,z)
  if isnumeric(z) then
  Dim adidss,adidssi
  adidss=split(adids&",",",")  
  For adidssi=0 to Ubound(adidss)-1
  if isnumeric(adidss(adidssi)) then
  conn.execute("Update Advertisement set ADipkg="&cint(z)&"  where ADid="&adidss(adidssi))
  if xmltype=1 then 
  call PubEditXml(dataxml&"/Advertisement/"&adidss(adidssi)&"/adv.xml","Advertisement","19",z)    '为 adv.xml 文件 ADipkg 设置新值
  end if
  end if 
  Next
  end if
  end sub


'/********************************************************************
' GGtiaoMain() 分页列表显示不同广告位的广告条 
'********************************************************************/

  sub GGtiaoMain()
  
  
  '' 开始设定不同的SQL查询条件,并根据条件的不同显示不同的提示信息
  
  addsql=" where ADid>0 "

  
   if trim(request("actions"))="by" then  '如果为备用 则直接查询
   addsql="  where  Pids&',' = ',' "
   dqw="备用箱 >> "
   end if
  

  
  
  if isnumeric(trim(request("pid"))) then  '根据 广告位id 进行查询
   
  dqw=Ggwm(trim(request("pid")))&" >> "
  
 
  addsql=addsql&" and ( Pids like '"&trim(request("pid"))&",%' or  Pids like '%,"&trim(request("pid"))&"'  or  Pids like '%,"&trim(request("pid"))&",%'  or  Pids like '"&trim(request("pid"))&"' ) "

  end if
  
  
  if isnumeric(trim(request("cid"))) then   '根据 分类 ID 进行查询
    
  rs.open "select cname from class where cid="&cint(trim(request("cid"))),conn,1,1
  if not rs.eof then
  dqw=rs(0)&" >> "
  else
  if trim(request("cid"))="0" then dqw="备用箱 >> "
  end if
  
  rs.close

  
  dim zsls
  i=0                      
  
  rs.open "select Pid from Place where cid="&cint(trim(request("cid"))),conn,1,1
  zsls=rs.recordcount
  if zsls>0 then
  
  addsql=addsql&"  and  ("              ' 如果有 则使用 and 进行多条件连接
  
  do while not rs.eof
  i=i+1
  addsql=addsql&" Pids like '"&rs(0)&",%' or  Pids like '%,"&rs(0)&"'  or  Pids like '%,"&rs(0)&",%'  or  Pids like '"&rs(0)&"' "
  
  if i<zsls then addsql=addsql&" or "
  rs.movenext
  loop  
  
  addsql=addsql&" ) "
  else
  addsql=addsql&"  and  Pids like 'a' "
  end if
  rs.close 
  
 
  end if
  

  if trim(request("xslx"))<>"" then
  xslxs=split(Replace(trim(request("xslx"))," ",""),",")  '去掉 request("xslx") 内所有 " " 然后将其转为数组
  xslx=""
  
  
  if Ubound(xslxs)<3 then
  addsql=addsql&" and  ("

  
  
  For i=0 To Ubound(xslxs)
  addsql=addsql&" ADxslei='"&xslxs(i)&"' "
  xslx=xslx&""&Ggxslx(xslxs(i))  
  if i<Ubound(xslxs) then xslx=xslx&"<font color=#000000>和</font>":addsql=addsql&" or "
  next
  xslx=xslx&"类 "
  addsql=addsql&" ) "
  
  end if
  end if
  
  if trim(request("act"))<>"" then
  acts=split(trim(request("act")),",")
  act=""
  if Ubound(acts)<2 then
  
  addsql=addsql&" and  ("

  
  
  For i=0 To Ubound(acts) 
  addsql=addsql&" ADact="&cint(acts(i))&" "
 
 
  act=Ggacts(acts(i))
  
  
  if i<Ubound(acts) then act=act&"<font color=#000000>或</font>":addsql=addsql&" or "
  next
  act=" <font color=#000000></font>"&act&"<font color=#000000>的</font>"
  addsql=addsql&" ) "
  end if
  end if
  
  
  
  if dqw="" then
  dqw="全部广告条"
  else
  dqw=dqw&xslx&act&"广告条"
  end if
  
  if trim(request("px"))<>"" then
  dqw=dqw&" 倒序排列"
  else
  dqw=dqw&" 顺序排列"
  end if
  
 
  Call Heads_GGtiao(dqw)
  

  
  
  '' 开始分页显示广告条主体效果
  
%>
 <SCRIPT language=javascript>
function menuChange(zi,menu)
{
	if(menu.style.display=="")
	{ 
	  menu.style.display="none";
	  zi.innerText="展开明细";
	  zi.style.color="";
	   
	}else{	   
	  menu.style.display="";
	  zi.innerText="关闭明细";
	  zi.style.color="red";
	   
	}
}
 </SCRIPT>

 <table  height="22"  border=1 width=100% cellspacing=0 cellpadding=2 bordercolorlight=#C0C0C0 bordercolordark=#FFFFFF bgcolor=#ffffff>
 <form name="form" action="?actions=<%=trim(request("actions"))%>&wei=<%=request("wei")%>&keyword=<%=request("keyword")%>&cid=<%=trim(request("cid"))%>&pid=<%=trim(request("pid"))%>" method="POST"><tr><td bgcolor=#F7F7F7>
	<p align="center"><b>类型:</b>
	
	 <%for i=0 to 4  %>    
   	<input type="checkbox" name="xslx" value="<%=PubFgdy(xsleienlb,"|",i)%>"><a title="仅显示图片类型" href="?actions=<%=trim(request("actions"))%>&wei=<%=request("wei")%>&keyword=<%=request("keyword")%>&cid=<%=trim(request("cid"))%>&pid=<%=trim(request("pid"))%>&xslx=<%= PubFgdy(xsleienlb,"|",i) %>&px=<%=trim(request("px"))%>"><%= PubFgdy(xsleicnlb,"|",i) %></a>
     <%next  %>	
	<b>&nbsp;状态:</b>
	<input type="checkbox" name="act" value="1"><a title="仅显示正常播放的" href="?actions=<%=trim(request("actions"))%>&wei=<%=request("wei")%>&keyword=<%=request("keyword")%>&cid=<%=trim(request("cid"))%>&pid=<%=trim(request("pid"))%>&act=1&px=<%=trim(request("px"))%>">正常</a>
	<input type="checkbox" name="act" value="0"><a title="仅显示暂停的" href="?actions=<%=trim(request("actions"))%>&wei=<%=request("wei")%>&keyword=<%=request("keyword")%>&cid=<%=trim(request("cid"))%>&pid=<%=trim(request("pid"))%>&act=0&px=<%=trim(request("px"))%>">暂停</a>
	<input type="checkbox" name="act" value="2"><a title="仅显示失效的" href="?actions=<%=trim(request("actions"))%>&wei=<%=request("wei")%>&keyword=<%=request("keyword")%>&cid=<%=trim(request("cid"))%>&pid=<%=trim(request("pid"))%>&act=2&px=<%=trim(request("px"))%>">失效</a> 
	<b>&nbsp;排序:</b><input type="radio" value="" name="px"><a title="顺序排列显示" href="?actions=<%=trim(request("actions"))%>&wei=<%=request("wei")%>&keyword=<%=request("keyword")%>&cid=<%=trim(request("cid"))%>&pid=<%=trim(request("pid"))%>&xslx=<%=trim(request("xslx"))%>&act=<%=trim(request("act"))%>&px=">顺序</a>
	<input type="radio" value=" order by ADid desc" checked name="px"><a title="倒序排列显示" href="?actions=<%=trim(request("actions"))%>&wei=<%=request("wei")%>&keyword=<%=request("keyword")%>&cid=<%=trim(request("cid"))%>&pid=<%=trim(request("pid"))%>&xslx=<%=trim(request("xslx"))%>&act=<%=trim(request("act"))%>&px= order by ADid desc">倒序</a> 
	<input type="submit" value="更新列表" name="B1"></td></tr></form>
 </table>
 <br>
<table border=0 cellspacing=0 cellpadding=0 width=100%>
<tr><td valign="top" width="160">
<%if trim(request("actions"))="by" then %>

 <table border=1 width=100% cellspacing=0 cellpadding=2 bordercolorlight=#C0C0C0 bordercolordark=#FFFFFF bgcolor=#ffffff>
<tr  align=center bgcolor=#F7F7F7 height=30><td class=red>说明:备用广告条的产生</td></tr>
<tr><td style="color: #808080" bgcolor="#FDFDFD"><br>
删除广告位时,保留了原有的独享广告条<br><br>
添加或修改广告条时位选择了无效的显示广告位<br><br>
</td></tr>
</table>
<%else '只有当不是备用查询时才显示左边 广告位导航%>
<table border=0 cellspacing=0 cellpadding=0 width=160 bgcolor=#FDFDFD  align=left>

<%
  dim sql2,rs2,cid,pid
  sql="select Cid,Cname from class order by cid"
  set rs=conn.execute(sql)
  do while not rs.eof
  cid=rs(0)
  if AdminClassIfkg(cid)="yes" then '' 只有当该分类有权被当前管理员可管时才显示
%>
<tr  height=30  bgcolor=#F7f7f7>
<td width=50  align=center><font class=red><b><font face="宋体">ID</font></b></font></td>
<td>
<a href='?cid=<%=cid%>'><%if isnumeric(trim(request("cid"))) then:if cid=int(trim(request("cid"))) then response.write "<font class=red><b>":end if%><%=rs(1)%></a>
</td></tr>

<%  sql2="select Pid,Pname from place where cid="&cid
    set rs2=conn.execute(sql2)
    do while not rs2.eof
    pid=rs2(0)
%>
<tr  height=20><td width=50  align=center><font class=red><%=rs2(0)%></font></td>
<td>
<a href='?pid=<%=pid%>'><%if isnumeric(trim(request("pid"))) then:if pid=int(trim(request("pid"))) then response.write "<font class=red>":end if%><%=rs2(1)%></a>
</td></tr>
<%  rs2.movenext
    loop
    rs2.close:set rs2=nothing
    end if
    rs.movenext
  loop
  rs.close
  
  
      IF AdminClassIfkg("all")="yes" then  '' 如果属总管 则显示备用箱
%>
<tr  height=30  bgcolor=#F7f7f7>
<td width=50  align=center><font class=red><b><font face="宋体">ID</font></b></font></td>
<td>
<a href='?cid=0'>备用广告位</a>
</td></tr>

<%  sql2="select Pid,Pname from place where cid=0"
    set rs2=conn.execute(sql2)
    do while not rs2.eof
    pid=rs2(0)
%>
<tr  height=20><td width=50  align=center><font class=red><%=rs2(0)%></font></td>
<td>
<a href='?pid=<%=pid%>'><%if isnumeric(trim(request("pid"))) then:if pid=int(trim(request("pid"))) then response.write "<font class=red>":end if%><%=rs2(1)%></a>
</td></tr>
<%  rs2.movenext
    loop
    rs2.close:set rs2=nothing
    
    END IF  
 
%>

</table>

<%end if%>



</td>
<td width=20></td>
<td valign="top">

<%
'' 如果不是  分类/广告位总管 且不是打开的单个广告位或分类,直接显示为第一个分类的广告条
if   AdminIfzg()="no" and isnumeric(trim(request("pid")))=false and  isnumeric(trim(request("cid")))=false then

response.redirect "?cid="&PubFgdy(PubFgdy(Session("ZonGGadminqx"),"#",1),",",0)

else   %>

 <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
  function checkAll(ks,js)
  { 
    for (var i=ks;i<js;i++)
    {
      var e = document.form1.elements[i];
      var boolValue = document.form1.selectAll.checked;
      if (e.name != "selectAll" )
	  {
        e.checked = boolValue;
	  }
    }
  }

  </SCRIPT>
  
 <table border=1 width=100% cellspacing=0 cellpadding=2 bordercolorlight=#C0C0C0 bordercolordark=#FFFFFF bgcolor=#ffffff>
      	<form method="POST" name="form1" action="<%=pageurl%>page=<%=trim(request("page"))%>"><tr  align=center bgcolor=#F7F7F7 height=30>
        <td width="50"><font color="#FF0000"><b>ID</b></font></td>
        <td width="120">广告条名称</td>
        <td width="120">链接地址</td>
        <td align="center">执行操作</td>
        <td align="center" width="30"><font class=red>全选</font>
		<input type="checkbox" name="selectAll" onClick="return checkAll(1,<%=nummer*3+1%>);" value="ON">
		</td>
      </tr>
      
      
<%


  i=0

  sql="select * from Advertisement "&addsql&" "&request("px")
  rs.open sql,conn,1,1
  
  
  '' 分页设置部分 
  
  if rs.eof and rs.bof then
    rssum=0
  else
    rssum=rs.recordcount
  end if
  
  call PubPageGs() 
  
  if int(viewpage)<>1 then
    rs.move (viewpage-1)*nummer
  end if
  
  for i=1 to nummer
  
  if rs.eof then exit for
  
  '''''''''''

%>
      <tr align=center>
        <td><font color="#FF0000"><%=rs("ADid")%> </font></td>
        <td>
		<input type="text" name="h" size="16" value="<%=rs("ADname")%>"></td>
        <td>
		<input type="text" name="h" size="16" value="<%=rs("ADurl")%>"></td>
        <td align="center">
        <span  onclick="menuChange(z<%=i%>,m<%=i%>);"  id="z<%=i%>"  style="CURSOR: hand">展开明细</span> 
        <a href=javascript:opw('GGtiaoCz.asp?a=Yl&id=<%=rs("ADid")%>','ZonGG<%=rs("ADid")%>',800,600)>预览</a>
       	<a href="GGtiaoEdit.asp?id=<%=rs("ADid")%>">修改</a>
       
<%
if rs("ADact")=1 then
%>           <a href="<%=pageurl%>page=<%=trim(request("page"))%>&action=act&actz=0&adids=<%=rs("ADid")%>">暂停</a>
<%
else
%>
              <a href="<%=pageurl%>page=<%=trim(request("page"))%>&action=act&actz=1&adids=<%=rs("ADid")%>"><font class=red>激活</font></a> 
<%end if%>

<%
if rs("ADipkg")=1 then
%>           <a href="<%=pageurl%>page=<%=trim(request("page"))%>&action=ip&ipz=0&adids=<%=rs("ADid")%>"><font class=red>关闭IP</font></a>
<%
else
%>
              <a href="<%=pageurl%>page=<%=trim(request("page"))%>&action=ip&ipz=1&adids=<%=rs("ADid")%>">打开IP</a> 
<%end if%>
		
		
              <a href="GGtiaoQl.asp?id=<%=rs("ADid")%>">清理</a>
 </td>
        <td align="center"><input type="checkbox" NAME="adids" value="<%=rs("ADid")%>"></td>
      </tr>
      
      <TBODY>
      <tr align=center  id="m<%=i%>" style="display='none'" >
        <td colspan="5"><iframe name="I1" src="GGtiaomx.asp?id=<%=rs("ADid")%>" marginwidth="0" marginheight="0" height="100%" width="100%" scrolling="no">
		无法调用 ... </iframe></td>
      </tr>
      </TBODY>

<%
    rs.movenext
 
  next

  rs.close

%>
     <tr height=50 class=td1>
      <td colspan="5"><font class="red">&nbsp;<b>将被选项</b></font> <input type="radio" value="act" name="action">状态 
		<select size="1" name="actz">
		<option value="1">激活</option>
		<option value="0">暂停</option>
		</select>
		<input type="radio" value="ip" checked name="action">IP记录 
		<select size="1" name="ipz">
		<option value="1">打开</option>
		<option value="0">关闭</option>
		</select>
		<%
		'' 暂时屏蔽 植入功能
		if nnnnn="yes" then%>
		<input type="radio" value="ip1" name="action">置入
		<%Call GgwClassSelect1(0)%>&nbsp;
		<%end if%>&nbsp;&nbsp;
		
		<input type="submit" value="执行" name="B2"></td>
      </tr> 
      
      <tr   height=30>
        <td colspan="5"> 共<%=rssum%> 条,分<%=thepages%>页 页码:<%=PubPage1(maxpage,thepages,viewpage,pageurl,pp,font_color)%></td>
      </tr>

      
      </form>
      
</table>
<%end if%>
</td></td></tr>

<%
  end sub

%>